{% extends "sqliscan/base.html" %}

{% block title %}DSScan{% endblock %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="glyphicon glyphicon-tasks"></i>
            TASK 搜索列表
            <span class="label label-warning pull-right">{{ num_result }}</span>
        </div>

        <div class="panel-body">
            <table class="table table-striped table-hover">
            <colgroup>
         	    <col style="width:25%">
         	    <col style="width:10%">
         	    <col style="width:10%">
         	    <col style="width:45%">
         	    <col style="width:10%">
         	</colgroup>

                <thead>
                    <th>URL</th>
                    <th>TASKID</th>
                    <th>STATUS</th>
                    <th>DATA</th>
                    <th>LOG</th>
                </thead>
                <tbody>
                    {% for result in search_result %}
                        {% if result.vulnerability %}
                            <tr class="danger">
                        {% else %}
                            <tr>
                        {% endif %}
                            <td>{{ result.target_url }}</td>
                            <td>{{ result.task_id }}</td>
                            <td>{{ result.scan_status }}</td>
                            <td>{{ result.scan_data }}</td>
                            <td>
                                <a  href="#{{ result.task_id }}" data-toggle="modal" data-target="#{{ result.task_id }}">
                                    <span class="glyphicon glyphicon-arrow-down"></span>
                                </a>
                                <div class="modal fade" id="{{ result.task_id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button data-dismiss="modal" class="close" type="button">
                                            <span aria-hidden="true">×</span>
                                            <span class="sr-only">Close</span>
                                        </button>
                                        <h4 class="modal-title">SCAN LOG</h4>
                                    </div>
                                    <div class="modal-body">
                                        {{ result.scan_log }}
                                    </div>
                                    <div class="modal-footer">
                                        <button data-dismiss="modal" class="btn btn-default" type="button">关闭</button>
                                    </div>
                                </div>
                                </div>
                                </div>
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>

{% endblock %}